package main

import (
	"flag"
	"github.com/golang/glog"
	"cloud_worm/util/unet/usocket"
	"cloud_worm/router/config"
	"sync"
	"cloud_worm/router/server"
)

const (
	configFile		= "./conf/config.conf"
	version 		= 100100101
)

func main()  {
	flag.Parse()
	glog.MaxSize = 1024 * 1024 *20
	usocket.SetOpenFileLimit()

	glog.Infof("Begin worm router, version: %d", version)
	if err := config.LoadConfig(configFile); err != nil {
		glog.Fatal(err)
		return
	}

	var wg sync.WaitGroup
	server.FileSrv(&wg)
	server.RouterSrv(&wg)
	server.DiagnoseSrv(&wg)

	wg.Wait()
	return
}

